/**
 * Include definitions 
 **/
#include <iostream>
#include "Player.h"
#include "Parser.h"
#include "Race.h"
#include "game.h"
 
/**
 * Main Function 
 **/
int main( int argc, const char* argv[] )
{
   string inputString;

   cout << "Welcome to the Game!\n\r";
   
   /* Set initial state to Login Entry */
   state = STATE_LOGIN_ENTRY;
   
   InfiniteGameLoop ( inputString );
      
   return 0;
}

/**
 * InfiniteGameLoop() function 
 **/
void InfiniteGameLoop ( string inputString )
{
   Parser *parser = new Parser();
   Player *player = new Player();
   int exitSignal;
	
   while ( 1 )
   {
	   /* Get the next line of input */
         getline ( cin, inputString );
         
	   /* Parse the line of input and store the return
		* value which indicates whether to exit out. */
		
	     exitSignal = parser->ParseCommand( parser, player );
         
	   /* If above exit signal is true, then terminate */
	     if ( exitsignal )
			 break;
	
	}
	
	free(parser);
	free(player);
}